<?php

class TestModel{

    public function __construct() {
    	$this->db = Yaf_Registry::get('db');
    }

    public function selectTest(){
    	return $this->db->query('select * from user');
        //$this->db->query($sql, $parameters = array(), $fetchmode = PDO::FETCH_ASSOC);
    }

    public function insertTest($data) {
        //$this->db->insert($tableName, array $data);
        //return $this->db->insertBatch($tableName, array $data);
    }
    public function insertTest1($tbName,$data)
    {
        return $this->db->insert($tbName,$data);
    }

    public function updateTest($data) {
        //$this->db->update($tableName, array $where, array $data, array $other=array());
    }
    public function updateTest1($tbName,$where,$data)
    {

        return $this->db->update($tbName,$where,$data);
    }
    public function insertBatchTest1($tbName,$data)
    {
        return $this->db->insertBatch($tbName,$data);
    }
    public function deleteTest($data) {
        //$this->db->delete($tableName, array $where, array $other=array());
    }
    public function deleteTest1($where,$data)
    {
        return $this->db->delete($where,$data);
    }
}
